import type { AxiosResponse } from 'axios'
import request from '@/utils/request'

const serviceName = import.meta.env.VITE_APP_SREVICE_NAME_CITY_MANAGEMENT

/**
 * 首页接口
 */
class HomeServe {
  /**
   * 获取division列表
   */
  getDivisionList<T = any>(params: RecordType): Promise<AxiosResponse<T>> {
    return request({
      url: `${serviceName}/cgjybzIndustry/mainPage`,
      method: 'get',
      params
    })
  }
  /**
   * 获取顶部菜单列表
   */
  getMainPageist<T = any>(): Promise<AxiosResponse<T>> {
    return request({
      url: `${serviceName}/cgjybzIndustryCloudMapInfo/mainPage`,
      method: 'get'
    })
  }
  /**
   * 异常指标总数
   */
  getAllAbnormalIndicatorsTotal<T = any>(): Promise<AxiosResponse<T>> {
    return request({
      url: `${serviceName}/cgjybzIndustryAnomalyIndex/getAllAbnormalIndicatorsTotal`,
      method: 'get'
    })
  }
  /**
   * 查询日程列表
   */
  getScheduleHelperList<T = any>(params: RecordType): Promise<AxiosResponse<T>> {
    return request({
      url: `${serviceName}/schedule-helper/list`,
      method: 'get',
      params
    })
  }
  /**
   * 查询推荐指标
   */
  getQuotasList<T = any>(): Promise<AxiosResponse<T>> {
    return request({
      // url: `${serviceName}/quota-recommend/getQuotas`,
      url: `${serviceName}/quota-recommend/indexRecommend`,
      method: 'get'
    })
  }
  /**
   * 查询重大事件
   */
  getEventsPoints<T = any>(params: RecordType): Promise<AxiosResponse<T>> {
    return request({
      url: `${serviceName}/event/getEventsPoints`,
      method: 'post',
      data: params
    })
  }
  /**
   * 查询重点指标
   */
  getKeyIndexNumber<T = any>(): Promise<AxiosResponse<T>> {
    return request({
      url: `${serviceName}/event/getKeyIndexNumber`,
      method: 'get'
    })
  }
  /**
   * 查询推荐专题
   */
  getScenes<T = any>(): Promise<AxiosResponse<T>> {
    return request({
      url: `${serviceName}/quota-recommend/getScenes`,
      method: 'get'
    })
  }
  /**
   * 推荐指标详情
   */
  getRightDetailsByTypeId<T = any>(params: RecordType): Promise<AxiosResponse<T>> {
    return request({
      url: `${serviceName}/cgjybzIndustry/getRightDetailsByTypeId`,
      method: 'get',
      params
    })
  }
}

export default new HomeServe()
